export const extend = Object.assign

export  const isObject = (obj)=> {
  return typeof obj === 'object' && obj !== null
}

export function hasChanged(val, newVal) {
  return !Object.is(val, newVal)
}

export const hasOwn = (obj, k) => Object.prototype.hasOwnProperty.call(obj, k)

export const capitalize= (str: string)=> {
  return str.charAt(0).toUpperCase() + str.slice(1)
}
export const handlerKey = (str: string)=> {
  return str ? 'on' + capitalize(camelize(str)) : str
}

export const camelize = (str: string)=> {
  return str.replace(/-(\w)/g, (_:string, c:string)=> {
    return c ? c.toUpperCase() : ''
  })
}